
<style type="text/css">
	.rule {
		text-align: center;
	}								
	.rule th {
		line-height: 24px;
		background: #ddd repeat-x;
		white-space: nowrap;
		margin-right: 5px;
		border: 1px solid #dcdcdc;
	}								
	tr {
		display: table-row;
		vertical-align: inherit;
		border-color: inherit;
	}								
	.rule td {
		background: #FFF;
		line-height: 22px;
		padding: 5px;
		border: 1px solid #dcdcdc;
	}
	
	.goods {									
		text-align: center;									
		display: none;
		padding: 3px;
	}
	.goods table{
		margin:5px auto;
		width: 80%;
	}								
	.goods th {
		line-height: 24px;
		background: #ddd repeat-x;
		white-space: nowrap;
		margin-right: 5px;
		border: 1px solid #dcdcdc;
	}								
	
	.goods::after {
		content: '';
		display: block;
		height: 15px;
	}								
	.goods_line {
		border: 1px solid black;
	}
	table a{
		margin-bottom:2px !important;
	}
</style>

<table class="table table-striped table-bordered table-hover rule" style="margin-bottom:0;width:100%">
	<tbody>
		<tr>
			<th  width="5%">序号</th>
			<th  width="15%">订单号</th>
			<th  width="15%">源系统订单号</th>
						<!-- 					<th  width="7%">收货人</th>
											<th  width="10%">收货人地址</th>
											<th  width="10%">电话</th> -->
											<th  width="7%">总价格</th>
											<th  width="8%">总数量</th>
											<!-- 	<th  width="5%">状态</th> -->
											<th  width="10%">采购标题</th>
											<th  width="10%">已交货数量</th>
											<th  width="8%">是否有效</th>
											<th  width="10%">创建时间</th>
											<th  width="12%">操作</th>
										</tr>
									</tbody>
								</table>
								<volist name="lists['lists']" id="vo" key="k">				
									<table class="table table-striped table-bordered table-hover rule" style="margin-bottom:0;width:100%">
										<tbody>
											<tr>

												<td  width="5%">
													<a href="#">{$k}</a>
												</td>
												<td  width="15%">{$vo.order_sn}</td>
												<td  width="15%">{$vo.source_order_sn}</td>
											<!-- 	<td  width="7%">{$vo.consignee}</td>
												<td  width="10%" style="word-break:break-all">{$vo.new_address}</td>
												<td  width="10%">{$vo.mobile}</td> -->
												<td  width="7%">{$vo.order_money}</td>
												<td  width="8%">{$vo.total}</td>
												<!-- <td  width="5%">{$array[$vo['status']]}</td> -->
												<td  width="10%">{$vo.bigorder_title}</td>
												<td  width="10%">{$vo.storage_quantity_total}</td>
												
												<td  width="8%">{$vo['pack_status'] ==1?'有效':'无效'}</td>
												<td class="hidden-480"  width="10%">{$vo.create_time|date="Y-m-d H:i:s",###}</td>
												<td  width="12%">
													<if condition="$vo.pack_status eq 0">
														<a class="btn btn-sm btn-success " onclick="sub_bean(this)"  url="{:U('Order/sub_bean',array('order_id'=>$vo['order_id'],'nav_id'=>$navid))}" >推送到51M</a>
													</if>

													<a class="btn btn-sm btn-success goods_infor_btn" >详　　情<i class="icon-chevron-down"></i><!-- <i class="icon-chevron-up"></i> --></a>

												</td>
											</tr>
										</tbody>
									</table>
									
									<div class="goods">
										<div class="goods_line"></div>
										<table class="table table-striped table-bordered table-hover">
											<tr>
												<th>序号</th>
												<th>51M货号</th>
												<th>商品条形码</th>
												<th>商品名称</th>
												<th>原价</th>
												<th>协商单价</th>
												<th>数量</th>
												<th>税率</th>
												<th>已交货数量</th>
												<th>预估交货时间</th>
												<th>小计</th>
											</tr>
											<volist name="vo['list']" id="v">
												<tr>
													<td>
														<a href="#">{$i}</a>
													</td>
													<td>{$v.goods_sn}</td>
													<td>{$v.bar_code}</td>
													<td>{$v.goods_name}</td>
													<td>{$v.goods_price}</td>
													<td>{$v.consult_price}</td>
													<td>{$v.quantity}</td>
													<td>{$v.taxrate}</td>
													<td>{$v.storage_quantity}</td>
													<td>{$v.delivery_time|date="Y-m-d H:i:s",###}</td>
													<td>{$v['consult_price'] * $v['quantity']}</td>
													
												</tr>
											</volist>
	<!-- 								<tr>
										<td width="10%">g2 meimei baby nat insect repellent【9316254120205】</td>
										<td width="15%">BM038</td>
										<td width="5%">0.70澳元</td>
										<td width="5%">100</td>
										<td width="5%">100</td>
										<td width="5%">-60</td>
									</tr> -->

								</table>

								<div class="goods_line"></div>
							</div>
							
						</volist>

						<!--测试-->

						<script type="text/javascript">
							$('.goods_infor_btn').click(function() {
								var i_cls = $(this).find('i').attr('class');
								if(i_cls == "icon-chevron-down"){
									$(this).find('i').attr('class',"icon-chevron-up");
								}else{
									$(this).find('i').attr('class',"icon-chevron-down");
								}
								var goods_infor = $('.goods');
								var index = $(this).index('.goods_infor_btn');
								goods_infor.eq(index).toggle();
							})
						</script>
						<table style=" float: right; margin-bottom:10px">
							<tr>
								<td style="text-align: right;"> <div class="page_list_ops dataTables_paginate paging_bootstrap pagination" >{$lists['page_html']}</div></td>
							</tr>
						</table>
						<script type="text/javascript">
							function sub_bean(_this){
								var url = $(_this).attr('url');
								_show_public_loading();
								$.ajax({
									'url':url,
									'dataType':'json',
									'type':'post',
									success:function(data){
										var retstatus = data.state == 1 ? "1" : "0";
										showvfmsg(retstatus, data.msg, 1900);
										return false;

									},error:function(){
										showvfmsg('error','请求服务器失败',2000);
									},complete:function(){
										_hide_public_loading();
									}
								});
							}
						</script>	
			<!-- 					<table id="sample-table-2" class="table table-striped table-bordered table-hover">
									<thead>
										<tr>
											<th  width="5%">序号</th>
											<th  width="10%">订单号</th>
											<th  width="10%">源系统订单号</th>
											<th  width="5%">收货人</th>
											<th class="hidden-480"  width="10%">收货人地址</th>
											<th  width="5%">电话</th>
											<th  width="5%">总价格</th>
											<th  width="5%">总数量</th>
											<th  width="5%">状态</th>
											<th  width="10%">采购标题</th>
											<th  width="10%">创建时间</th>
											<th  width="5%">操作</th>
										</tr>
									</thead>
									<tbody>
										<volist name="lists['lists']" id="vo">
											<tr>

												<td  width="5%">
													<a href="#">{$i}</a>
												</td>
												<td  width="10%">{$vo.order_sn}</td>
												<td  width="10%">{$vo.source_order_sn}</td>
												<td  width="5%">{$vo.consignee}</td>
												<td class="hidden-480"  width="10%">{$vo.new_address}</td>
												<td  width="5%">{$vo.mobile}</td>
												<td  width="5%">{$vo.order_money}</td>
												<td  width="5%">{$vo.total}</td>
												<td  width="5%">{$array[$vo['status']]}</td>
												<td  width="10%">{$vo.bigorder_title}</td>
												<td class="hidden-480"  width="10%">{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                                                 <td  width="5%"><button type="button" class="btn btn-sm btn-info"  onclick="_es_openDilog90('{:U('DirectionalPurchase/DPGoodsDetails',array('order_id'=>$vo['order_id']))}','预订单采购记录','yudingdancaigoujilu')"> 查看商品</button></td>
											</tr>
										</volist>
									</tbody>
								</table>
							
					<table style="width: 80%; float: right; margin-bottom:10px">
					    <tr>
					        <td style="text-align: right;"> <div class="page_list_ops dataTables_paginate paging_bootstrap pagination" >{$lists['page_html']}</div></td>
					    </tr>
					</table>

<script type="text/javascript">


    $(function(){
        $("#tbmain tr").hover(function(){
            $(this).css({"background-color":"rgba(243, 236, 236, 0.72)"});
        },function(){
            $(this).css({"background-color":"#fff"});
        });

         $("#alldel").bind("click",checkSel);
    });

     function checkSel(){
       var flg= $(this).is(":checked");
       $("input[type='checkbox']").prop("checked",flg);
    }

   function selallval(){
     var _list="";
     $("#sample-table-2 input[type='checkbox']:checked").each(function(){
         // var flg=$(this).is(":checked");
         //if(!flg)return false;
         var _val=$(this).val();
         if(_val!=""){
         _list+= (_list==""?"":",")+"'"+_val+"'";
         } 
     });
     return _list;
} 



    function _es_openDilog90(url, title,id){ 
     art.dialog.open(url, { title: title, width: '1000px', height: '80%', opacity: 0.2, id: id, fixed: true, close:function(){load();}  });
}
}
</script> 